package com.wh.order.pojo;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.wh.custom.pojo.CustomMycustom;
import com.wh.org.pojo.Employee;
import com.wh.productMag.pojo.ProductList;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * 实体类：
 */
@Data
@Accessors(chain = true)
public class OrderList implements Serializable {

    /**
     * 订单号
     */
    @TableId
    private String orderSn;
    /**
     * 归属人id
     */
    private Long personId;
    /**
     * 客户id
     */
    private Integer customerId;
    /**
     * 订单金额
     */
    private BigDecimal orderAmount;
    /**
     * 支付方式 1欠款 2支付宝 3微信 4银行卡
     */
    private String payType;
    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     * 最后操作时间
     */
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastOperationTime;
    /**
     * 发货方式
     */
    private String logisticsMethods;
    /**
     * 物流公司
     */
    private String logisticsCompanies;
    /**
     * 物流单号
     */
    private String trackingNumber;
    /**
     * 订单状态  1未发货 2已发货 3取消
     */
    private Integer orderState;

    private Integer productId;

    //所属部门  不是数据库字段
    @TableField(exist = false)
    private Employee employee;
    @TableField(exist = false)
    private CustomMycustom customer;
    @TableField(exist = false)
    private ProductList productList;

    private String notes;

    private String voucher;

    private Integer paymentStatus;

    private BigDecimal totalSalesAmount;//总金额

    private Integer findingOfAudit;//审核结果

    private  String reviewRemarks; //审核备注



    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime deliveryTime;
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime successTime;

    private String reasonForCancellation;

    private String receipt;
    @TableField(exist = false)
    private Long loginId;//登录人id

    private Long productNumber;

    @TableField(exist = false)
    private String stock;//仓库
    /**
     * 收货人信息
     */
    private Integer orderDetailId;
    /**
     * 初级审核人
     */

    private Integer orderReviewerId;

    @TableField(exist = false)
    private OrderDetail orderDetail; //关联收货人信息



    //用产品对象封装数据，保存产品,用集合实现多产品下单
    @TableField(exist = false)
    private List<OrderProducid> orderProducids;
    private BigDecimal salePrice;//成交价

    private String remarks;//发货备注,物流备注
}
